<?php
/**
 * <https://y.st./>
 * Copyright © 2018 Alex Yst <mailto:copyright@y.st>
 * 
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 * 
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
 * GNU General Public License for more details.
 * 
 * You should have received a copy of the GNU General Public License
 * along with this program. If not, see <https://www.gnu.org./licenses/>.
**/

$xhtml = array(
	'<{title}>' => '<code>minechest</code>',
	'takedown' => '2017-11-01',
	'<{body}>' => <<<END
<img src="/img/CC_BY-SA_4.0/y.st./weblog/2018/12/03.jpg" alt="On the bike path, looking back toward home" class="framed-centred-image" width="649" height="480"/>
<section id="drudgery">
	<h2>Drudgery</h2>
	<p>
		My discussion post for the day:
	</p>
	<blockquote>
		<p>
			You make a good point about big and little endian being for values that need to be split.
			We were asked about big and little endian integers, but to properly understand big and little endian, it helps to realise that these concepts don&apos;t apply strictly to integers.
			For example, big and little endian can also be used in text files, where it applies to the byte order used for multi-byte Unicode characters.
			These characters can&apos;t be stored as a single byte, so their bytes have to be stored in some order; typically big or little endian.
		</p>
		<p>
			It looks like we found the same exploits as far as integer overflow.
			It seems buffer overflows and monetary calculations might be the main problems caused by going out of bounds with our integers.
		</p>
	</blockquote>
</section>
<section id="Minetest">
	<h2>Minetest</h2>
	<p>
		I tinkered with Minetest some more, mostly working on making the stat displays work better.
		First off, I&apos;ve upped the allowed stat count for the $a[HUD] back up to 32.
		It&apos;s kind of ugly working around the mini map, but Minetest 5.0.0-dev has 31 stats right now.
		When 5.0.0 proper releases, it&apos;ll probably have at least these 31 stats, if not more.
		It&apos;d be odd to have some of them just left out of the $a[HUD].
		I&apos;ve also modified the in-menu stat page.
		If the $a[HUD] is installed and can process all the stats, the stat summary pages - which would otherwise display information made redundant by the $a[HUD] - vanish.
		Only the itemised pages remain.
		This feature requires an updated version of both mods though, as one has the feature and the other reports the information about itself that the feature needs to function.
	</p>
	<p>
		I&apos;d sort of lost sight of what&apos;s needed to actually make Minetest play fun before, and focussed only on building that path.
		However, what I&apos;d really enjoy is a secret treasury, and settable warp points so I can drop stuff off there as I loot the land while building out that path.
		I think I know where I want to put my treasury.
		I might switch locations before I get to building it, but it&apos;s definitely got to be somewhere I don&apos;t think other people will find it.
		Keeping it hidden is part of the fun!
		I&apos;m probably going to wait until 5.0.0 releases to actually start a world I plan to keep though.
		5.0.0 is just too different from 0.4.17, and I don&apos;t want to start the world in a development version.
	</p>
	<p>
		<del>I guess my main issue at the moment is deciding how to award warp points and other goodies to players.
		I&apos;m thinking maybe I should start players out with a small inventory, and allow them one warp point for every ninth stack of countables they mine.
		For any stack them mine other than these ninth ones, they get another inventory slot.
		They can work their way up to the standard 32-slot inventory, but after that, they can actually earn slots beyond that which allow them to pack around more than they could in an unmodified Minetest Game.
		I don&apos;t think I&apos;m going to try to separate different abilities based on what materials get mined any more.
		There are just too many countable materials and not enough abilities that I actually want to add.</del>
	</p>
	<p>
		<ins>I figured it out.
		Finally.
		At work, I came up with a sort of chest I wanted to add to the game that would, within the chest, cause items to stack to the full extent the game can handle, which is typically much more than any item definition actually allows.
		When players withdraw items from this chest though, the chest will only allow them to take however much the normal maximum stack is, making it so item storage is only compacted within the chest.
		I tried coming up with several ways to tie these chest to the elements in some way, but everything I could come up with was completely arbitrary.
		Without mining stats involved in some way, the elements have no actual meaning.
		And that&apos;s when I figured it out.
		I needed to combine this idea with another that I&apos;d given up on in the past, as well as another I&apos;d shelved due to not having multiplayer connectivity at my home.
		As you may or may not remember, a while back, I wanted to make rare, decorative nodes that required 2<sup>16</sup>-1 of any element to craft.
		Each element had its own node that could be crafted, and you&apos;d need to put in a lot of effort to get any one of them.
		Basically, they were trophy nodes, like the old PB&amp;J Pup nodes that got removed from the game, but with a different spin on how they were obtained.
		They took more effort, and less luck.
		More recently, I wanted to make unlockable skins with differing abilities for players.
		The main thing I wanted from that idea was the skins themselves, but I thought players might not care if there wasn&apos;t something they actually did; some reason to actually want them.
		Taking pieces from all these ideas, my new idea is a set of chest that exist in the actual game world like the trophy nodes, are unlocked via the stats instead of by paying a high material cost, like the skins, and have differing appearances, like the skins and (to an extent) the trophy nodes.
		(I&apos;d actually drawn all the trophy nodes already, and they were mostly palette swaps, but with different symbols on them.)
		These chest can hold any item, allowing it to stack as high as the engine will allow.
		They&apos;ll have the same number of inventory slots as a regular chest though, so they&apos;ll only hold thirty-two different kinds of items at once.
		And when you&apos;ve mined enough of a given material, you&apos;ll earn one chest themed after that material.
		You can earn another by mining that many of the material again, or you can try for a chest with a different theme.
		In particular, I imagine coral-themed chest will be the hardest to acquire.
		I can&apos;t even be sure they&apos;re obtainable even if you scoured the entire surface of a solo world and mined all the coral.
		Ice chests and permafrost chests might not be possible either, though they have a higher probability of possibility.</ins>
	</p>
	<p>
		<ins>Probably the best part of this idea is that it doesn&apos;t create too heavy of a reliance on stats, but still provides a decent reward for those that do try.
		With warp points and player inventory sizes, you pretty much get penalised for not caring about stat points.
		These chests just mean you get to brag and shrink your treasury size.
		And a large treasury might be more impressive anyway.
		I think I might call this new mod <code>minechest</code>.</ins>
	</p>
</section>
END
);
